Relation between [[Prototype]] and prototype in JavaScript

Posted by Claudiu on Stack Overflow See other posts from Stack Overflow or by Claudiu
Published on 2008-12-20T11:04:14Z Indexed on 2010/03/18 17:31 UTC
Read the original article Hit count: 738

From http://www.jibbering.com/faq/faq_notes/closures.html :

Note: ECMAScript defines an internal [[prototype]] property of the internal Object type. This property is not directly accessible with scripts, but it is the chain of objects referred to with the internal [[prototype]] property that is used in property accessor resolution; the object's prototype chain. A public prototype property exists to allow the assignment, definition and manipulation of prototypes in association with the internal [[prototype]] property. The details of the relationship between to two are described in ECMA 262 (3rd edition) and are beyond the scope of this discussion.

What are the details of the relationship between the two? I've browsed through ECMA 262 and all I've read there is stuff like:

The constructor’s associated prototype can be referenced by the program expression constructor.prototype,

Native ECMAScript objects have an internal property called [[Prototype]]. The value of this property is either null or an object and is used for implementing inheritance.

Every built-in function and every built-in constructor has the Function prototype object, which is the initial value of the expression Function.prototype

Every built-in prototype object has the Object prototype object, which is the initial value of the expression Object.prototype (15.3.2.1), as the value of its internal [[Prototype]] property, except the Object prototype object itself.

From this all I gather is that the [[Prototype]] property is equivalent to the prototype property for pretty much any object. Am I mistaken?

© Stack Overflow or respective owner

Related posts about ecma262

Related posts about programming-languages